An optical encoder has a rotary coding plate secured to a shaft, a fixed coding plate arranged to oppose the rotary coding plate with a predetermined spacing therebetween and secured to a housing, a light source, and a light-receiving element which receives the light from the light source via the rotary coding plate and fixed coding plate, and is adapted so as to be able to detect the rotating direction, rotational speed or rotational angle of the shaft using the output of the light-receiving element produced when the shaft is rotated.
When the noise tolerability of the optical encoder is considered, a case in which the noise source is external and a case in which it is internal must be taken into account.
With regard to noise from an external source, noise tolerability can be enhanced with comparative ease by physically surrounding the encoder in a space of 0[V]. However, enhancing noise tolerability with respect to noise generated internally is considerably more difficult. In particular, since the rotary shaft is a source of noise in the optical encoder, a pattern portion (a portion on which chrome is formed by vapor deposition) on the rotary coding plate secured to the shaft and a pattern portion on the fixed coding plate secured to the housing form secondary noise sources due to electromagnetic induction and, hence, it is difficult to enhance noise tolerability. More specifically, since noise tolerability is proportional to the square of distance from the noise source, it is necessary to keep at a distance from the noise source. In an optical encoder, however, in order to assure an output signal level from the light-receiving element, a small gap of less than 1 mm is required between the light-receiving element and the fixed coding plate, and a very small gap of 70-90 .mu.m is required between the fixed coding plate and the rotary coding plate. For this reason, the distance between the fixed coding plate, which is a source of noise, and the light-receiving element cannot be lengthened. Furthermore, in order to surround (shield) the light-receiving element by 0[V], a dielectric capable of being reduced to 0[V] is required to be inserted between the light-receiving element and the fixed coding plate. However, this also is very difficult to achieve in terms of space.